import request from '@/utils/request'

// 查询原材料批次号列表
export function listMaterial(query) {
  return request({
    url: '/crop/material/list',
    method: 'get',
    params: query
  })
}

// 添加原材料批次号列表
export function addMaterial(data) {
  return request({
    url: '/crop/material',
    method: 'post',
    data: data
  })
}


// 修改原材料批次号列表
export function updateMaterial(data) {
  return request({
    url: '/crop/material',
    method: 'put',
    data: data
  })
}

export function deleteMaterialById(ids) {
  return request({
    url: '/crop/material/del?ids=' + ids,
    method: 'delete'
  })
}

//三级联动
export function listCity() {
  return request({
    url: '/crop/city/cityMenu',
    method: 'get'
  })
}

// 根据id获取原材料批次号列表
export function getById(materialLotId) {
  return request({
    url: '/crop/material/getById?materialLotId='+materialLotId,
    method: 'get',

  })
}

// 农产品主表遍历
export function listCrop(query) {
  return request({
    url: '/crop/material/croplist',
    method: 'get',
    params: query
  })
}

